<template>
    个人信息页
    <p>姓名: {{ $store.state.userInfo.name }}</p>
    <p>性别: {{ $store.state.userInfo.gender }}</p>
    <p>手机号: {{ $store.state.userInfo.phone }}</p>

    <p>姓名: {{userInfo.name }}</p>
    <p>性别: {{ userInfo.gender }}</p>
    <p>手机号: {{ userInfo.phone }}</p>
</template>

<script setup>
import { computed} from 'vue'
import {useStore} from 'vuex'

// store的实例化对象
const store = useStore()

const userInfo = computed(()=> store.state.userInfo)

</script>